package com.forensix.interface_test.utils;

import io.restassured.RestAssured;
import io.restassured.filter.log.RequestLoggingFilter;
import io.restassured.filter.log.ResponseLoggingFilter;
import org.apache.commons.io.output.WriterOutputStream;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
public class PrintStreamLogUtil {

    public static void printStreamLog(){
        FileWriter fileWriter = null;
        try{
            fileWriter =   new FileWriter(GetBaseDirUtil.getBaseDir() + "/log/test.log");
            PrintStream printStream = new PrintStream(new WriterOutputStream(fileWriter), true);
            RestAssured.filters( RequestLoggingFilter.logRequestTo (printStream), ResponseLoggingFilter.logResponseTo (printStream));
        }catch (IOException e){
            e.printStackTrace();
        }





    }

}
